home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 3 / PCPP #3.iso / editors / deep / hexspecs.doc < prev    next >
Encoding:
Text File  |  1996-02-07  |  71.5 KB  |  2,605 lines

  1.  
  2.                  HEXEN Specs v0.9+
  3.  
  4.              The Official Hexen Technical Specs
  5.          Author: Ben Morris (bmorris@islandnet.com)
  6.         Information from Raven provided by Ben Gokey
  7.           Additional information by Sensor Based Systems, Inc.
  8.  
  9.                    [Disclaimer]
  10.  
  11.   The text contained in this document is for informational purposes only.  
  12.   If you decide to use this information in any way, neither id Software, 
  13.   Raven Software, Ben Morris, nor SBS can be held responsible for any damages 
  14.   or losses (including, but not limited to: dismembered bodily parts, 
  15.   telefrags and lack of sleep) incurred by this information's use.  Although
  16.   this is an "Official" specification, some of the information contained 
  17.   within might be old, or just plain typed in wrong. You have been warned.
  18.  
  19.                      !!!
  20.  
  21.   NB: This version of the specs, 0.9, is a preliminary release.  Most of
  22.       the information here is tried and true, but there's a good chance there 
  23.       are errors in the file.  If something doesn't look right, or really IS 
  24.       wrong, please contact me (Ben Morris) at the address above.  Please do 
  25.       NOT contact me about new versions of the specs; I will release the new 
  26.       versions when they are ready.  Thanks.
  27.  
  28.   NOTE : 
  29.      This document was edited and reformatted with some additions to 
  30.      make it easier to view on screen or to clarify. The form feeds were 
  31.      removed to save paper. Sections were added as noted.
  32.  
  33.  
  34. ┌───┬───────────────────────────────────────────────────────────────────────
  35. │ ■ │ Table of Contents (added to original)
  36. └───┘
  37.  
  38.       1. About this file
  39.       2. Definitions used in this File
  40.       3. Introduction to Hexen  
  41.       4. Hexen Data Structures 
  42.       5. Hexen Script Language 
  43.       6. Flats with special properties 
  44.       7. The MAPINFO lump
  45.       8. PolyObjects 
  46.       9. List of Spawnable Objects
  47.      10. List of Activateable/Deactivateable Objects
  48.      11. List of THINGS that require arguments 
  49.      12. Sector Specials
  50.      13. Action Specials 
  51.      14. Sector Sounds for ChangeSectorSound() special
  52.      15. Sounds for ThingSound()  (added)
  53.      16. Key Numbers 
  54.  
  55.  
  56.  
  57. ┌───┬───────────────────────────────────────────────────────────────────────
  58. │ 1 │ About This File
  59. └───┘
  60.  
  61.   This file was written for those who are interested in the inner workings of
  62.   Hexen.  It doesn't contain playing tips or information on how to get Hexen
  63.   working on your system.
  64.  
  65.   This file is intended to be supplementary to Matt Fell's "Unofficial DOOM
  66.   Specs", which probably came with your copy of DOOM or DOOM ][.  Wherever
  67.   it's relevant, this file refers to a specific section in the DOOM specs (be
  68.   sure you have version 1.666 or later!), so it's a good idea to have a copy 
  69.   at hand.
  70.  
  71.   You can also refer to the online Help in DeeP for further reference to
  72.   basic definitions.
  73.  
  74. ┌───┬───────────────────────────────────────────────────────────────────────
  75. │ 2 │ Definitions used in this File
  76. └───┘
  77.  
  78.       Angle [0..255]  Used in "angle" parameters to Special types:
  79.  
  80.         0       East            32      Northeast
  81.         64      North           96      Northwest
  82.         128     West            160     Southwest
  83.         192     South           224     Southeast
  84.  
  85.           * NOTE that this differs from DOOM/Heretic in that 45/90
  86.         degree increments are not used.  However, this difference
  87.         does _not_ apply for the angles used for the THINGS in
  88.         map editing - they are the same as DOOM's (eg: 0 = East,
  89.         90 = North, etc.)
  90.  
  91.      Tics       Time unit of length 1/35 second.  So, 35 tics = 1 second.
  92.  
  93.      Octics     Time unit of length 8 tics.  So, 8 octics = 1 second.
  94.  
  95.  
  96. ┌───┬───────────────────────────────────────────────────────────────────────
  97. │ 3 │ Introduction to Hexen
  98. └───┘
  99.  
  100.   Hexen is the sequel to Heretic, Raven Software's first collaboration with id
  101.   Software.
  102.  
  103.   Hexen's major difference from Heretic and DOOM is its programmability.  
  104.   Hexen features a powerful script language that can be used to create a wide 
  105.   variety of in-game effects such as traps, puzzles and even earthquakes!
  106.  
  107.  
  108. ┌─────┬─────────────────────────────────────────────────────────────────────
  109. │ 4   │ Hexen Data Structures
  110. └─────┘
  111.  
  112.   This section outlines the format of the new data blocks in a Hexen map - 
  113.   the LINEDEF and THING structures.  These structures have changed from the
  114.   versions used in DOOM and Heretic [see DOOM Specs ref and DeeP help].
  115.  
  116.    The Hexen LINEDEF structure
  117.    ---------------------------
  118.  
  119.     Offset      Size        Meaning
  120.     ---------------------------------------------------
  121.     0           word        the line's start-vertex
  122.     2           word        the line's end-vertex
  123.     4           word        line flags (see below)
  124.     6           byte        special type (see [Specials])
  125.     7         5 bytes       special arguments
  126.     12          word        the line's right sidedef number
  127.     14          word        the line's left sidedef number
  128.  
  129.  
  130.     Line Flags
  131.     ----------
  132.  
  133.     The following flags are starred with an asterisk if they're new for
  134.     Hexen:
  135.  
  136.     Bits        Meaning when Set
  137.     ---------------------------------------------------
  138.     0           impassable - the line cannot be crossed.
  139.     1           impassable to monsters only.
  140.     2           two-sided
  141.     3           upper texture is unpegged        (drawn from top-down)
  142.     4           lower/middle texture is unpegged (drawn from bottom-up)
  143.     5           secret - the line appears as impassable on the automap.
  144.     6           sound can't travel through the line for monsters' ears.
  145.     7           never draw the line on the auto-map, even with the
  146.         map cheat enabled.
  147.     8           the line is always drawn on the auto-map, even if it
  148.         hasn't been seen by the player.
  149.  
  150.   * 9           the line's special ([3-1]) is repeatable, ie: it can
  151.         be activated more than once.
  152.   * 10..12      the line's special activation, ie: how the special is
  153.         activated.
  154.  
  155.         Value   Activated when...
  156.         ---------------------------------------------
  157.         0       Player crosses the line
  158.         1       Player uses the line with the use key
  159.         2       Monster crosses the line
  160.         3       Projectile impacts the wall
  161.         4       Player pushes the wall
  162.         5       Projectile crosses the line
  163.  
  164.         To get the special activation, use the following formula:
  165.  
  166.         activation := (line.flags BITAND 0x1C00) BITSHIFTRIGHT 10
  167.  
  168.  
  169.     The Hexen THING structure
  170.     --------------------------
  171.  
  172.     Offset      Size        Meaning
  173.     ---------------------------------------------------
  174.   * 0           word        thing ID - used in scripts and specials to
  175.                 identify a THING or a set of THINGs.
  176.     2           word        x-position on the map
  177.     4           word        y-position on the map
  178.   * 6           word        starting altitude on the map - the THING
  179.                 is created at this altitude above the floor
  180.                 of the sector it's in when the map is entered,
  181.                 and is immediately subjected to gravity.
  182.     8           word        the angle the thing is facing when the map
  183.                 is entered.
  184.     10          word        the thing type (see below)
  185.   * 12          word        thing flags    (see below)
  186.     14          byte        special type (see [Specials]).  a thing's
  187.                 special is activated when the thing is
  188.                 killed (Monster), destroyed (Tree, Urn, etc.),
  189.                 or picked up (Artifact, Puzzle Piece.)
  190.     15        5 bytes       special arguments, 1 byte each
  191.  
  192.  
  193.    Thing Flags
  194.    -----------
  195.  
  196.    The following flags are starred with an asterisk if they're new for
  197.    Hexen:
  198.  
  199.     Bits        Meaning when Set
  200.     ---------------------------------------------------
  201.     0           the thing appears on the Easy skill settings (1-2)
  202.     1           the thing appears on the Normal skill setting (3)
  203.     2           the thing appears on the Hard skill settings (4-5)
  204.     3           the thing is deaf - it sits around until it's
  205.         hurt, or until it sees a player.
  206.   * 4           the thing is dormant - it never wakes up until it's
  207.         activated using the Thing_Activate() special.
  208.   * 5           the thing appears for the Fighter class.
  209.   * 6           the thing appears for the Cleric class.
  210.   * 7           the thing appears for the Mage class.
  211.   * 8           the thing appears in single-player games.
  212.   * 9           the thing appears in cooperative games.
  213.   * 10          the thing appears in deathmatch games.
  214.  
  215.  
  216.   Each "thing appears" flag must be set for each condition under which the
  217.   thing is to appear.  For multi-player games involving more than one
  218.   class, a thing that is set for one of the classes involved will also appear
  219.   for the other two classes in the game.
  220.  
  221.   For example, if you set the three pieces of the Fighter's sword to appear
  222.   for only the Fighter (bit 5 is set) and in Deathmatch (bit 10 is set),
  223.   if a Mage or a Cleric is also playing, the pieces of the sword will be
  224.   visible to them, too.
  225.  
  226.  
  227.   Thing Types
  228.   -----------
  229.  
  230.   Creatures as well as some objects can be activated and/or deactivated with
  231.   the ThingActivate and ThingDeactivate line specials.
  232.  
  233.   Creatures will freeze when deactivated and resume when activated.
  234.   Activation can also be used to bring a "dormant" creature to life.
  235.  
  236.   If a creature has a special, that special will be activated upon its death.
  237.   Also, if the creature is teleported away using the banishment device
  238.   (teleport other), the special will be activated and then removed from the
  239.   creature.
  240.  
  241.   [ Sorted list created by SBS, original was hard to find stuff in ]
  242.  
  243.     Type      Name
  244.     -----------------------------------------------------------
  245.     1         Player_1_start
  246.     2         Player_2_start
  247.     3         Player_3_start
  248.     4         Player_4_start
  249.     5         Z_WingedStatue
  250.     6         ZC_Rock1
  251.     7         ZC_Rock2
  252.  
  253.     9         ZC_Rock3
  254.     10        2C_SerpentStaff
  255.     11        Player_Deathmatch
  256.     12        4F_3Blade
  257.     13        4F_2Crosspiece
  258.     14        Player_TeleportSpot
  259.     15        ZC_Rock4
  260.     16        4F_1Hilt
  261.     17        Z_Chandelier
  262.     18        4C_3Arc
  263.     19        4C_2Cross
  264.  
  265.     20        4C_1Shaft
  266.     21        4M_3Skull
  267.     22        4M_2Stub
  268.     23        4M_1Stick
  269.     24        ZF_TreeDead
  270.     25        ZF_TreeDestructible
  271.     26        ZS_Tree2
  272.     27        ZS_Tree1
  273.     28        ZF_StumpBurned
  274.     29        ZF_StumpBare
  275.  
  276.     30        A_Porkelator
  277.     31        C_Demon
  278.     32        A_HealingComplete (Urn)
  279.     33        A_Torch
  280.     34        C_Wraith
  281.     36        A_ChaosDevice
  282.     37        ZS_Stump1
  283.     38        ZS_Stump2
  284.     39        ZF_ShroomLarge1
  285.     40        ZF_ShroomLarge2
  286.  
  287.     41        ZC_ShroomLarge
  288.     42        ZC_ShroomSmall1
  289.  
  290.     44        ZC_ShroomSmall2
  291.     45        ZC_ShroomSmall3
  292.     46        ZF_ShroomSmall1
  293.     47        ZF_ShroomSmall2
  294.     48        ZC_Stalagmite_Pillar
  295.     49        ZC_StalagmiteLarge
  296.  
  297.     50        ZC_StalagmiteMedium
  298.     51        ZC_StalagmiteSmall
  299.     52        ZC_StalactiteLarge
  300.     53        2M_ConeOfShards
  301.     54        Z_Wall_Torch_Lit
  302.     55        Z_Wall_Torch_Unlit
  303.     56        ZC_StalactiteMedium
  304.     57        ZC_StalactiteSmall
  305.     58        ZS_Moss1
  306.     59        ZS_Moss2
  307.  
  308.     60        ZS_Vine
  309.     61        ZG_CorpseKabob
  310.     62        ZG_CorpseSleeping
  311.     63        ZG_TombstoneRIP
  312.     64        ZG_TombstoneShane
  313.     65        ZG_TombstoneBigCross
  314.     66        ZG_TombstoneBrianR
  315.     67        ZG_TombstoneCrossCircle
  316.     68        ZG_TombstoneSmallCross
  317.     69        ZG_TombstoneBrianP
  318.  
  319.     71        ZG_CorpseHanging
  320.     72        ZP_GargPortalTall
  321.     73        ZP_GargIceTall
  322.     74        ZP_GargPortalShort
  323.     76        ZP_GargIceShort
  324.     77        Z_Banner
  325.     78        ZF_TreeLarge1
  326.     79        ZF_TreeLarge2
  327.  
  328.     80        ZF_TreeGnarled1
  329.     81        A_HealingWimpy (Vial)
  330.     82        A_HealingHefty (Flask)
  331.     83        A_WingsOfWrath
  332.     84        A_IconOfDefender
  333.     86        A_DarkServant
  334.     87        ZF_TreeGnarled2
  335.     88        ZS_Log
  336.     89        ZI_IcicleLarge
  337.  
  338.     90        ZI_IcicleMedium
  339.     91        ZI_IcicleSmall
  340.     92           IcicleSmall  (missing in spec)
  341.     93        ZI_IceSpikeLarge
  342.     94        ZI_IceSpikeMedium
  343.     95        ZI_IceSpikeSmall
  344.     96           IceSpikeTiny (missing in spec)
  345.     97        ZW_RockBrownLarge
  346.     98        ZW_RockBrownSmall
  347.     99        ZW_RockBlack
  348.  
  349.     100       ZM_Rubble1
  350.     101       ZM_Rubble2
  351.     102       ZM_Rubble3
  352.     103       Z_VasePillar
  353.     104       ZM_Pot1
  354.     105       ZM_Pot2
  355.     106       ZM_Pot3
  356.     107       C_Centaur
  357.     108       ZG_CorpseLynched
  358.     109       ZG_CorpseNoHeart
  359.  
  360.     110       ZG_CorpseSitting
  361.     111       ZG_BloodPool
  362.  
  363.     113       Spawn_Leaf
  364.     114       C_Bishop
  365.     115       C_CentaurLeader
  366.     116       Z_TwinedTorch
  367.     117       Z_TwinedTorch_Unlit
  368.     118       Z_GlitterBridge
  369.     119       Z_Candle
  370.  
  371.     120       C_SerpentLeader
  372.     121       C_Serpent
  373.     122       Mana_1
  374.     123       3F_Hammer
  375.     124       Mana_2
  376.  
  377.     140       Z_TeleportSmoke
  378.  
  379.     254       C_Dragon  (Death Wyvern)
  380.  
  381.     1400      SS_Stone
  382.     1401      SS_Heavy
  383.     1402      SS_Metal
  384.     1403      SS_Creak
  385.     1404      SS_Silent
  386.     1405      SS_Lava
  387.     1406      SS_Water
  388.     1407      SS_Ice
  389.     1408      SS_EarthCrack
  390.     1409      SS_Metal2
  391.     1410      SE_Wind
  392.  
  393.     3000      PO_Anchor
  394.     3001      PO_StartSpot
  395.     3002      PO_StartSpot_Crush
  396.  
  397.     8000      A_Repulsion
  398.     8002      A_BootsOfSpeed
  399.     8003      A_BoostMana
  400.     8004      ManaCombined
  401.     8005      Ar_Armor
  402.     8006      Ar_Shield
  403.     8007      Ar_Helmet
  404.     8008      Ar_Amulet
  405.     8009      3C_Firestorm
  406.     8010      2F_Axe
  407.     8020      C_IceGuy
  408.  
  409.     8030      K_SteelKey
  410.     8031      K_CaveKey
  411.     8032      K_AxeKey
  412.     8033      K_FireKey
  413.     8034      K_CastleKey
  414.     8035      K_DungeonKey
  415.     8036      K_SilverKey
  416.     8037      K_RustyKey
  417.     8038      K_WasteKey
  418.     8039      K_SwampKey
  419.  
  420.     8040      3M_Lightning
  421.     8041      A_Bracers
  422.     8042      Z_FireBull
  423.     8043      Z_FireBull_Unlit
  424.     8044      ZP_GargCorrode
  425.     8045      ZP_GargLavaDrkTall
  426.     8046      ZP_GargLavaBrtTall
  427.     8047      ZP_GargBrnzTall
  428.     8048      ZP_GargStlTall
  429.     8049      ZP_GargLavaDrkShort
  430.     8050      ZP_GargLavaBrtShort
  431.     8051      ZP_GargBrnzShort
  432.     8052      ZP_GargStlShort
  433.  
  434.     8060      Z_FireSkull
  435.     8061      Z_BrassBrazier
  436.     8062      ZF_DestructibleTree
  437.     8063      Z_Chandelier_Unlit
  438.     8064      Z_ArmorSuit
  439.     8065      Z_Bell
  440.     8066      Z_BlueCandle
  441.     8067      ZG_IronMaiden
  442.     8068      ZF_Hedge
  443.     8069      Z_Cauldron
  444.     8070      Z_Cauldron_Unlit
  445.     8071      Z_Chain32
  446.     8072      Z_Chain64
  447.     8073      Z_ChainHeart
  448.     8074      Z_ChainLHook
  449.     8075      Z_ChainSHook
  450.     8076      Z_ChainSpikeBall
  451.     8077      Z_ChainSkull
  452.  
  453.     8080      C_Demon2
  454.  
  455.     8100      Z_Barrel
  456.     8101      ZF_Shrub1
  457.     8102      ZF_Shrub2
  458.     8103      Z_Bucket
  459.     8104      ZF_ShroomBoom
  460.  
  461.     8200      K_GoldKey
  462.  
  463.     8500      ZM_LgStein
  464.     8501      ZM_SmStein
  465.     8502      ZM_CandleWeb
  466.     8503      ZM_SmCandle
  467.     8504      ZM_LgCandle
  468.     8505      ZM_GobletSpill
  469.     8506      ZM_GobletTall
  470.     8507      ZM_GobletSmall
  471.     8508      ZM_GobletSilver
  472.     8509      ZM_CleaverMeat
  473.  
  474.     9001      X_MapSpot
  475.     9002      ZZ_Skull
  476.     9003      ZZ_BigGem
  477.     9004      ZZ_GemRed
  478.     9005      ZZ_GemGreen1
  479.     9006      ZZ_GemBlue1
  480.     9007      ZZ_Book1
  481.     9008      ZZ_Book2
  482.     9009      ZZ_GemGreen2
  483.     9010      ZZ_GemBlue2
  484.     9011      ZZ_WingedStatueNoSkull
  485.     9012      ZZ_GemPedestal
  486.     9013      X_MapSpotGravity
  487.     9014      ZZ_Skull2
  488.     9015      ZZ_FWeapon
  489.     9016      ZZ_CWeapon
  490.     9017      ZZ_MWeapon
  491.     9018      ZZ_Gear
  492.     9019      ZZ_Gear2
  493.     9020      ZZ_Gear3
  494.     9021      ZZ_Gear4
  495.  
  496.     10000     Spawn_Fog
  497.     10001     Spawn_Fog_a
  498.     10002     Spawn_Fog_b
  499.     10003     Spawn_Fog_c
  500.  
  501.     10011     C_Wraith2
  502.     10030     C_Ettin
  503.     10040     A_Banishment
  504.     10060     C_FireImp
  505.     10080     C_Heresiarch
  506.  
  507.     10090     Spike_Down
  508.     10091     Spike_Up
  509.  
  510.     10100     C_FighterBoss
  511.     10101     C_ClericBoss
  512.     10102     C_MageBoss
  513.     10110     A_Flechette
  514.     10120     A_HealRadius
  515.  
  516.     10200     C_Korax
  517.  
  518.     10225     Spawn_Bat
  519.  
  520.     10500     Z_SmallFlame_Timed
  521.     10501     Z_SmallFlame_Permanent
  522.     10502     Z_LargeFlame_Timed
  523.     10503     Z_LargeFlame_Permanent
  524.  
  525.  
  526. ┌─────┬─────────────────────────────────────────────────────────────────────
  527. │ 5   │ Hexen Script Language
  528. └─────┘
  529.  
  530.   The Hexen Script Language is called the "Action Code Script", or ACS.
  531.  
  532.   Each map has an ACS file that contains the scripts specific to that map.  
  533.   The scripts within it are identified using numbers that the general special
  534.   ACS_Execute() uses.  
  535.   
  536.   A script itself can call the ACS_Execute() special, which will spawn 
  537.   another script that will run concurrently with the rest of the scripts.  
  538.   A script can also be declared as OPEN, which will make it run automatically 
  539.   upon entering the map.  This is used for perpetual type effects, level 
  540.   initialization, etc.  
  541.   
  542.   The compiler takes the ACS file and produces and object file that is the 
  543.   last lump in the map WAD (BEHAVIOR).
  544.  
  545.   To create a compiled ACS file from a text script from DOS type:
  546.  
  547.   C:\HEXEN > ACS filename [enter]
  548.  
  549.   The output of ACS produces 'filename.o' from 'filename.acs'. The contents 
  550.   of this output file (filename.o) can be directly used as the BEHAVIOR 
  551.   lump of the map it's to be used with.
  552.  
  553.  
  554.   SBS Note : DeeP and other editors directly integrate seamless support for 
  555.          the ACS compiler without having to exit to DOS. The new
  556.          behavior Lump can be directly saved with no additional steps
  557.          required. There are 2 examples of scripts. One is SCRIPTS.ACS
  558.          and the other is HEXENTUT.ACS, with corresponding PWAD files.
  559.  
  560.  
  561.   Script Shared Structure
  562.   -----------------------
  563.  
  564.   Map scripts should start with #include "common.acs", which is just...
  565.  
  566.   #include "specials.acs"
  567.   #include "defs.acs"
  568.   #include "wvars.acs"
  569.  
  570.   The file "specials.acs" defines all the general specials.  These are used
  571.   within scripts just like function calls.  The file "defs.acs" defines a
  572.   bunch of constants that are used by the scripts.  The file "wvars.acs"
  573.   defines all the world variables.  It needs to be included by all maps so
  574.   they use consistent indexing.
  575.  
  576.  
  577.   Variables and their Scope
  578.   -------------------------
  579.  
  580.   There is only one data type ACS, a 4 byte integer.  Use the keyword int to
  581.   declare an integer variable.  You may also use the keyword str, it is
  582.   synonymous with int.  It's used to indicate that you'll be using the
  583.   variable as a string.  The compiler doesn't use string pointers, it uses
  584.   string handles, which are just integers.
  585.  
  586.   Declaring a variable
  587.   --------------------
  588.  
  589.   There are two "types" of variables: 1. "str"
  590.                       2. "int":
  591.  
  592.     examples:
  593.     ---------
  594.  
  595.     str mystring;
  596.     int myint;
  597.  
  598.     or:
  599.  
  600.     str texture, sound;
  601.     int i, tid;
  602.  
  603.   * Note: You can't assign a variable in its declaration; you must give it a
  604.     value in a different expression.
  605.  
  606.   The SCOPE of a variable is one of the following:
  607.  
  608.       1. World-scope
  609.       2. Map-scope, 
  610.       3. Script-scope.
  611.  
  612.   1. World-scope
  613.  
  614.      World-scope variables are global, and can be accessed in any map.
  615.      Hexen maintains [n] permanent globals, numbered 0-[n-1].  You must
  616.      assign one of the globals a name in order to access it, like this:
  617.  
  618.     world int 5:Grunt;
  619.  
  620.      This tells Hexen to reference world global number 5 whenever it
  621.      encounters the name "Grunt".
  622.  
  623.   2. Map-scope
  624.  
  625.      Map-scope variables are local to the current map.  They must be
  626.      declared outside of any script code, but without the world keyword.
  627.      These variables can't be accessed in any other map.
  628.  
  629.      Script-scope variables are local to the current script - they
  630.      can't be accessed by any other script or map.
  631.  
  632.    Here's some code that shows the declaration of all three scopes:
  633.  
  634.       world int 3:DungeonAccess; // World-scope
  635.  
  636.       int mapTimer; // Map-scope
  637.  
  638.       script 4 (void)
  639.       {
  640.       int x, y; // Script-scope
  641.       ...
  642.       }
  643.  
  644.  
  645.   Language Structure
  646.   -------------------
  647.  
  648.   Here is a quick reference manual type definition of the language.  It
  649.   ends with a description of all the internal functions.
  650.  
  651.   Keywords
  652.   --------
  653.  
  654.   The following identifiers are reserved for use as keywords, and may
  655.   not be used otherwise:
  656.  
  657.     break
  658.     case
  659.     const
  660.     continue
  661.     default
  662.     define
  663.     do
  664.  
  665.     else
  666.     goto
  667.     if
  668.     include
  669.     int
  670.  
  671.     open
  672.     print
  673.     printbold
  674.     restart
  675.  
  676.     script
  677.     special
  678.     str
  679.     suspend
  680.     switch
  681.  
  682.     terminate
  683.     until
  684.     void
  685.     while
  686.     world
  687.  
  688.   Comments
  689.   --------
  690.  
  691.   Comments are ignored by the script compiler. There are two forms: 
  692.   
  693.      1. /*...you comment... */   
  694.        All information between the first /* and last */ is ignored. 
  695.        The leading /* and trailing */ are required.
  696.      2. //
  697.        All information past the // is ignored
  698.  
  699.   examples:
  700.  
  701.     /*
  702.        This is a comment.
  703.     */
  704.  
  705.     int a;   // And this is a comment
  706.  
  707.  
  708.  
  709.   World-variable definitions
  710.   ---------------------------
  711.  
  712.   world int <constant-expression> : <identifier> ;
  713.  
  714.   world int <constant-expression> : <identifier> , ... ;
  715.  
  716.  
  717.   Map-variable definitions
  718.   ------------------------
  719.  
  720.   Declares a variable local to the current map.
  721.  
  722.   int <identifier> ;
  723.   str <identifier> ;
  724.   int <identifier> , ... ;
  725.  
  726.  
  727.   Include Directive
  728.   -----------------
  729.  
  730.   Includes the source of the specified file and compiles it. This acts the
  731.   same as if you have "included" the source in the file it resides in. Use
  732.   this to make a common reference set of code you use often.  
  733.  
  734.   #include <string-literal>
  735.  
  736.   The supplied required includes shown earlier are an illustration:
  737.  
  738.      #include "specials.acs"
  739.      #include "defs.acs"
  740.      #include "wvars.acs"
  741.  
  742.   Define Directive
  743.   ----------------
  744.  
  745.   Replaces an identifier with a constant expression.
  746.  
  747.   #define <identifier> <constant-expression>
  748.  
  749.   Whenever "identifier" is used in the source, the "constant-expression"
  750.   is substituted. This is sort of like a macro or keyboard short-cut.
  751.  
  752.  
  753.   Constant Expressions
  754.   --------------------
  755.  
  756.   <integer-constant>:
  757.  
  758.   decimal      200
  759.   hexadecimal  0x00a0, 0x00A0
  760.   fixed point  32.0, 0.5, 103.329
  761.  
  762.   any radix    <radix>_digits :
  763.  
  764.      binary        2_01001010
  765.      octal         8_072310
  766.      decimal       10_50025
  767.      hexadecimal   16_00a03f2
  768.  
  769.  
  770.   String Literals
  771.   ---------------
  772.  
  773.   <string-literal>: "string"
  774.  
  775.   Example : "Hello there"
  776.  
  777.  
  778.   Script Definitions
  779.   ------------------
  780.  
  781.   To define a script:
  782.  
  783.   <script-definition>:
  784.   script <constant-expression> ( <arglist> ) { <statement> }
  785.   script <constant-expression> OPEN { <statement> }
  786.  
  787.   e.g.:
  788.  
  789.   script 10 (void) { ... }
  790.  
  791.   script 5 OPEN { ... }
  792.  
  793.   * Note that OPEN scripts do not take arguments.
  794.  
  795.  
  796.   Statements
  797.   ----------
  798.  
  799.   <statement>:
  800.  
  801.     <declaration-statement>
  802.     <assignment-statement>
  803.     <compound-statement>
  804.     <switch-statement>
  805.     <jump-statement>
  806.     <selection-statement>
  807.     <iteration-statement>
  808.     <function-statement>
  809.     <linespecial-statement>
  810.     <print-statement>
  811.     <control-statement>
  812.  
  813.  
  814.   Declaration Statements
  815.   ----------------------
  816.  
  817.   Declaration statements create script variables.
  818.  
  819.   <declaration-statement>:
  820.     int <variable> ;
  821.     int <variable> , <variable> , ... ;
  822.  
  823.  
  824.   Assignment Statements
  825.   ---------------------
  826.  
  827.   Assigns an expression to a variable.
  828.  
  829.   <assignment-statement>:
  830.     <variable> <assignment-operator> <expression> ;
  831.  
  832.   <assignment-operator>:
  833.      =
  834.     +=
  835.     -=
  836.     *=
  837.     /=
  838.     %=
  839.  
  840.   * Note: An assignment of the form V <op>= E is equivalent to V = V <op> E.
  841.     For example:
  842.  
  843.     A += 5;     is the same as
  844.     A = A + 5;
  845.  
  846.   Compound Statements
  847.   -------------------
  848.  
  849.   <compound-statement>:
  850.     { <statement-list> }
  851.  
  852.   <statement-list>:
  853.     <statement> <statement> <...>
  854.  
  855.  
  856.   Switch Statements
  857.   -----------------
  858.  
  859.   A switch statement evaluates an integral expression and passes control 
  860.   to the code following the matched case.
  861.  
  862.   <switch-statement>:
  863.  
  864.     switch ( <expression> ) { <labeled-statement-list> }
  865.  
  866.    <labeled-statement>:
  867.  
  868.      case <constant-expression> : <statement>
  869.      default : <statement>
  870.  
  871.   Example:
  872.  
  873.     switch (a)
  874.     {
  875.     case 1:         // when a == 1
  876.     b = 1;      // .. this is executed,
  877.     break;      // and this breaks out of the switch().
  878.     case 2:         // when a == 2
  879.     b = 8;      // .. this is executed,
  880.             // but there is no break, so it continues to the next
  881.             // case, even though a != 3.
  882.     case 3:         // when a == 3
  883.     b = 666;    // .. this is executed,
  884.     break;      // and this breaks out of the switch().
  885.     default:        // when none of the other cases match,
  886.     b = 777;    // .. this is executed.
  887.     }
  888.  
  889.    Note for C users: 
  890.  
  891.     While C only allows integral expressions in a switch
  892.     statement, ACS allows full expressions such as "a + 10".
  893.  
  894.  
  895.   Jump Statements
  896.   ---------------
  897.  
  898.   A jump statement passes control to another portion of the script.
  899.  
  900.   <jump-statement>:
  901.  
  902.     continue ;
  903.     break ;
  904.     restart ;
  905.  
  906.  
  907.   Iteration Statements
  908.   --------------------
  909.  
  910.   <iteration-statement>:
  911.  
  912.     while ( <expression> ) <statement>
  913.     until ( <expression> ) <statement>
  914.     do <statement> while ( <expression> ) ;
  915.     do <statement> until ( <expression> ) ;
  916.     for ( <assignment-statement> ; <expression> ; <assignment-statement> )
  917.       <statement>
  918.  
  919.    The continue, break and restart keywords can be used in an iteration
  920.    statement:
  921.  
  922.     - the continue keyword jumps to the end of the last <statement> in the
  923.       iteration-statement.  The loop continues.
  924.  
  925.     - the break keyword jumps right out of the iteration-statement.
  926.  
  927.  
  928.   Function Statements
  929.   --------------------
  930.  
  931.   A function statement calls a Hexen internal-function, or a Hexen
  932.   linespecial-function.
  933.  
  934.   <function-statement>:
  935.  
  936.     <internal-function> | <linespecial-statement>
  937.  
  938.   <internal-function>:
  939.  
  940.     <identifier> ( <expression> , ... ) ;
  941.     <identifier> ( const : <constant-expression> , ... ) ;
  942.  
  943.   <linespecial-statement>:
  944.  
  945.     <linespecial> ( <expression> , ... ) ;
  946.     <linespecial> ( const : <constant-expression> , ... ) ;
  947.  
  948.  
  949.   Print Statements
  950.   ----------------
  951.  
  952.   <print-statement>:
  953.  
  954.     print ( <print-type> : <expression> , ... ) ;
  955.     printbold ( <print-type> : <expression> , ... ) ;
  956.  
  957.     <print-type>:
  958.  
  959.       s   string
  960.       d   decimal
  961.       c   constant
  962.  
  963.  
  964.  
  965.   Selection Statements
  966.   --------------------
  967.  
  968.   <selection-statement>:
  969.  
  970.     if ( <expression> ) <statement>
  971.     if ( <expression> ) <statement> else <statement>
  972.  
  973.  
  974.   Control Statements
  975.   ------------------
  976.  
  977.   <control-statement>:
  978.  
  979.     suspend ;         // suspends the script
  980.     terminate ;       // terminates the script
  981.  
  982.  
  983.   Internal Functions
  984.   -------------------
  985.  
  986.    void tagwait(int tag);
  987.    ----------------------
  988.  
  989.    The current script is suspended until all sectors marked with
  990.    <tag> are inactive.
  991.  
  992.  
  993.    void polywait(int po);
  994.    ----------------------
  995.  
  996.    The current script is suspended until the polyobj marked with
  997.    <po> is incactive.
  998.  
  999.  
  1000.    void scriptwait(int script);
  1001.    ----------------------------
  1002.  
  1003.    The current script is suspended until the script specified by
  1004.    <script> has terminated.
  1005.  
  1006.  
  1007.    void delay(int ticks);
  1008.    ----------------------
  1009.  
  1010.    The current script is suspended for a time specified by <ticks>.
  1011.    A tick represents one cycle from a 35Hz timer.
  1012.  
  1013.  
  1014.    void changefloor(int tag, str flatname);
  1015.    ----------------------------------------
  1016.  
  1017.    The floor flat for all sectors marked with <tag> is changed to
  1018.    <flatname>.
  1019.  
  1020.  
  1021.    void changeceiling(int tag, str flatname);
  1022.    ------------------------------------------
  1023.  
  1024.     The ceiling flat for all sectors marked with <tag> is changed to
  1025.     <flatname>.
  1026.  
  1027.  
  1028.    int random(int low, int high);
  1029.    ------------------------------
  1030.  
  1031.    Returns a random number between <low> and <high>, inclusive.  The
  1032.    values for <low> and <high> range from 0 to 255.
  1033.  
  1034.  
  1035.    int lineside(void);
  1036.    -------------------
  1037.  
  1038.    Returns the side of the line the script was activated from.  Use
  1039.    the macros LINE_FRONT and LINE_BACK, defined in "defs.acs".
  1040.  
  1041.  
  1042.    void clearlinespecial(void);
  1043.    ----------------------------
  1044.  
  1045.    The special of the line that activated the script is cleared.
  1046.  
  1047.  
  1048.    int playercount(void);
  1049.    ----------------------
  1050.  
  1051.    Returns the number of active players.
  1052.  
  1053.  
  1054.    int gametype(void);
  1055.    -------------------
  1056.    
  1057.    Returns the type of game being played:
  1058.  
  1059.      GAME_SINGLE_PLAYER
  1060.      GAME_NET_COOPERATIVE
  1061.      GAME_NET_DEATHMATCH
  1062.  
  1063.  
  1064.    int gameskill(void);
  1065.    --------------------
  1066.  
  1067.    Returns the skill of the game being played:
  1068.  
  1069.      SKILL_VERY_EASY
  1070.      SKILL_EASY
  1071.      SKILL_NORMAL
  1072.      SKILL_HARD
  1073.      SKILL_VERY_HARD
  1074.  
  1075.    Example:
  1076.  
  1077.      int a;
  1078.      a = gameskill();
  1079.  
  1080.      switch( gameskill() )
  1081.      {
  1082.        case SKILL_VERY_EASY:
  1083.        ...
  1084.        case SKILL_VERY_HARD:
  1085.        ...
  1086.      }
  1087.  
  1088.  
  1089.    int timer(void);
  1090.    ----------------
  1091.  
  1092.    Returns the current leveltime in ticks.
  1093.  
  1094.  
  1095.    void sectorsound(str name, int volume);
  1096.    ---------------------------------------
  1097.  
  1098.    Plays a sound in the sector the line is facing.  <volume> has the
  1099.    range 0 to 127.
  1100.  
  1101.  
  1102.    void thingsound(int tid, str name, int volume);
  1103.    -----------------------------------------------
  1104.  
  1105.    Plays a sound at all things marked with <tid>.  <volume> has the
  1106.    range 0 to 127.  See section 15 for values.
  1107.  
  1108.  
  1109.    void ambientsound(str name, int volume);
  1110.    ----------------------------------------
  1111.  
  1112.    Plays a sound that all players hear at the same volume.  <volume> has
  1113.    the range 0 to 127.  See section 15 for values. 
  1114.  
  1115.  
  1116.    void soundsequence(str name);
  1117.    -----------------------------
  1118.  
  1119.    Plays a sound sequence in the sector the line is facing.
  1120.  
  1121.  
  1122.    int thingcount(int type, int tid);
  1123.    ----------------------------------
  1124.  
  1125.    Returns a count of things in the world.  Use the thing type definitions
  1126.    in defs.acs for <type>.  Both <type> and <tid> can be 0 to force the
  1127.    counting to ignore that information.
  1128.  
  1129.    Examples:
  1130.  
  1131.    // Count all ettins that are marked with TID 28:
  1132.    c = thingcount(T_ETTIN, 28);
  1133.  
  1134.    // Count all ettins, no matter what their TID is:
  1135.    c = thingcount(T_ETTIN, 0);
  1136.  
  1137.    // Count all things with TID 28, no matter what their type is:
  1138.    c = thingcount(0, 28);
  1139.  
  1140.  
  1141.    void setlinetexture(int line, int side, int position, str texturename);
  1142.    -----------------------------------------------------------------------
  1143.  
  1144.    Sets a texture on all lines identified by <line>.  A line is identified by
  1145.    giving it the special Line_SetIdentification in a map editor.
  1146.  
  1147.    <side>:
  1148.  
  1149.      SIDE_FRONT
  1150.      SIDE_BACK
  1151.  
  1152.    <position>:
  1153.  
  1154.      TEXTURE_TOP
  1155.      TEXTURE_MIDDLE
  1156.      TEXTURE_BOTTOM
  1157.  
  1158.    Examples:
  1159.  
  1160.    setlinetexture(14, SIDE_FRONT, TEXTURE_MIDDLE, "ice01");
  1161.    setlinetexture(3, SIDE_BACK, TEXTURE_TOP, "forest03");
  1162.  
  1163.  
  1164.    void setlineblocking(int line, int blocking);
  1165.    ---------------------------------------------
  1166.  
  1167.    Sets the blocking (impassable) flag on all lines identified by <line>.
  1168.  
  1169.    <blocking>:
  1170.  
  1171.      ON
  1172.      OFF
  1173.  
  1174.    Example:
  1175.  
  1176.    setlineblocking(22, OFF);
  1177.  
  1178.  
  1179.    void setlinespecial(int line, int special, int arg1, int arg2,
  1180.                int arg3, int arg4, int arg5);
  1181.    _______________________________________________________________
  1182.  
  1183.    Sets the line special and args on all lines identified by <line>.
  1184.  
  1185.  
  1186. ┌─────┬─────────────────────────────────────────────────────────────────────
  1187. │ 6   │ Flats with special properties
  1188. └─────┘
  1189.  
  1190.     Lava            Lava does damage
  1191.     Water           Makes things sink
  1192.     Sludge          Makes things sink
  1193.     Ice             Changes friction
  1194.  
  1195.  
  1196. ┌─────┬─────────────────────────────────────────────────────────────────────
  1197. │ 7   │ The MAPINFO lump
  1198. └─────┘
  1199.  
  1200.     This is a lump in the .WAD that gives attributes to each map.  This entry
  1201.     does not go with each map - there is only one MAPINFO lump in the entire
  1202.     IWAD.  If you include a MAPINFO lump in a PWAD, make sure it's got
  1203.     information for all the possible maps the player will be entering.
  1204.  
  1205.     map:        Number and name of map [1..60]
  1206.     warptrans:  Actual map number in case maps are not sequential [1..60]
  1207.     next:       Map to teleport to upon exit of timed deathmatch [1..60]
  1208.     cdtrack:    CD track to play during level
  1209.     cluster:    Defines what cluster level belongs to
  1210.     sky1:       Default sky texture; followed by speed
  1211.     sky2:       Alternate sky displayed in Sky2 sectors ; followed by speed
  1212.     doublesky:  parallax sky: sky2 behind sky1
  1213.     lightning:  Keyword indicating use of lightning on the level
  1214.         flashes from sky1 to sky2 (see also: IndoorLightning special)
  1215.     fadetable:  Lump Name of fade table {fogmap}
  1216.  
  1217.     Example MapInfo entry:
  1218.  
  1219.         map 1 "Winnowing Hall"
  1220.         warptrans 1
  1221.         next 2
  1222.         cluster 1
  1223.         sky1 SKY2 2             ; 2 is the sky scroll speed
  1224.         sky2 SKY3 0             ; 0 means don't scroll sky
  1225.         lightning
  1226.         doublesky
  1227.         cdtrack 13
  1228.  
  1229.  
  1230.   Note on "next" integer (for timed deathmatches):
  1231.  
  1232.   In normal gameplay, there is no linear fashion in which the game
  1233.   progresses from one level to another; you just go through a teleport
  1234.   somewhere on a level, and it takes you to somewhere on another
  1235.   level.  
  1236.   
  1237.   For -timer deathmatch, the game needs to know what level to
  1238.   proceed to because it isn't always just the next higher level.
  1239.  
  1240.   A note about the WARPTRANS keyword:  Maps are edited and named
  1241.   MAPxx, where xx is a number from 01 to 63.  This is the number that
  1242.   is used from within scripts when a map is referred to, and by the
  1243.   MAP keyword in the MAPINFO lump.  
  1244.   
  1245.   However, the -warp option and the warping cheat use a different set 
  1246.   of numbers.  This different set of numbers is set by the WARPTRANS keyword.  By default, the WARPTRANS
  1247.   value is set to the same number as the map.  
  1248.   
  1249.   Our designers starting making maps with numbers that had big gaps between 
  1250.   them, and then made the scripts refer to these numbers, so we needed a 
  1251.   way to pack all the map numbers into a continuous stream for the -warp 
  1252.   option. Also, the accepted range for a WARPTRANS value is 1-31.  Makes it
  1253.   easy when using DM.
  1254.  
  1255.  
  1256.   Note on "cluster" integer:
  1257.   -------------------------
  1258.  
  1259.   The game maps are divided into clusters.  When you enter a new cluster, 
  1260.   you can never again visit any of the levels from the previous cluster.  
  1261.   This makes it so each individual save game only needs to backup map 
  1262.   archives for about 6-7 maps, and provides for a milestone marker of 
  1263.   sorts for game play, like an episode .
  1264.   
  1265.   A Hexen backdrop and some text are given at the end of each cluster.  
  1266.   If you don't enter a cluster, it defaults to 0.  The commercial IWAD 
  1267.   separates its 31 maps into 5 clusters.
  1268.  
  1269.  
  1270. ┌─────┬─────────────────────────────────────────────────────────────────────
  1271. │ 8   │ PolyObjects
  1272. └─────┘
  1273.  
  1274.   Polyobjs are one-sided lines that are built somewhere else on the map, and
  1275.   then later translated to the desired start spot on the map at level load.
  1276.  
  1277.   In building polyobjs, two different line specials can be used to determine
  1278.   the line drawing order:
  1279.  
  1280.     Polyobj_ExplicitLine(polyNumber, orderNumber, polyMirror, sound);
  1281.  
  1282.     Polyobj_StartLine   (polyNumber, polyMirror, sound);
  1283.  
  1284.   Each polyobj should have a unique polyNumber, which is used in poly line
  1285.   specials to refer to a particular polyobj.
  1286.  
  1287.   polyMirror refers to a second polyobj that will "mirror" all actions of the
  1288.   first polyobj.  For instance, if a polyobj is rotated to the right by 90
  1289.   degrees, then that polyobj's mirror will rotate left 90 degrees.  
  1290.   
  1291.   Note that having two polyobjs mirror each other is not considered to be a 
  1292.   good thing, but in general won't cause problems because a poly can only 
  1293.   do one particular action at a time.  
  1294.   
  1295.   Meaning:  if that poly that rotated left by 90 degrees then mirrored the 
  1296.   right-turning polyobj, the right-turning poly would ignore any attempt 
  1297.   to rotate it again, as it would already be being acted upon.
  1298.  
  1299.   The last parameter to these specials refers to a particular sound type
  1300.   that should play when the poly is moved/rotated.  See the section on
  1301.   attaching sounds to a moving sector for more info.
  1302.  
  1303.  
  1304.   Polyobj_StartLine():
  1305.   --------------------
  1306.  
  1307.   A very basic special.  Place it on a particular polyobj line, and that line
  1308.   will be the first line rendered on the polyobj.  
  1309.   
  1310.   The rendering order for all other lines are determined by iterating through 
  1311.   to the next line that has a first point identical to the start line's second 
  1312.   point.  The third line rendered will be the next line that has a first point 
  1313.   identical to the second line's second point, and so on and so forth.  
  1314.   
  1315.   This method works well for polyobjs that are convex, and has the advantage 
  1316.   of leaving all but one line free for other line specials.
  1317.  
  1318.   Polyobj_ExplicitLine:
  1319.   ---------------------
  1320.  
  1321.   This special requires a bit more work to use.  Each line in the polyobj
  1322.   defined using this special must use this line special.  Then, a value from
  1323.   1-255 should be placed in orderNumber.  
  1324.   
  1325.   This defines the rendering order for the lines, with a 1 being the first 
  1326.   line rendered, and so on.  Useful for non-convex polyobjs, but has the 
  1327.   disadvantage of utilizing all line specials on the poly.
  1328.  
  1329.  
  1330.   Polyobj Start Spots and Anchor Points
  1331.   -------------------------------------
  1332.  
  1333.   Each polyobj must have an anchor point, and a startSpot.  The anchor is a
  1334.   thing placed near the polyobj when it's created that defines the origin of
  1335.   the polyobj, or the point in which it will rotate about.  The anchor (and 
  1336.   all polyobj lines) are directly translated to the polyobj startSpot.
  1337.  
  1338.   Bottom line:  The anchor point is the point near the polyobj, and the
  1339.   startSpot is the point on the actual map that defines the location of the
  1340.   poly.
  1341.  
  1342.   There are two different types of startSpots:  crushing and non-crushing.
  1343.   Pretty obvious what the difference is:  if the poly strikes an object, 
  1344.   it'll first attempt to move it.  If that fails it will either try to damage 
  1345.   the object, or just stop moving depending upon the type of startSpot.
  1346.  
  1347.   Please note that the ANGLE field of the startSpot and anchor points should 
  1348.   be equal to the polyNumber that was previously defined for that particular
  1349.   polyobj.  The polyobj stuff was done before any of the TID/thing special 
  1350.   code was implimented, so Raven did this temporary hack, which turned 
  1351.   permanent, as the designers had already done a ton of polyobjs, and didn't 
  1352.   want to have to go back and replace them.
  1353.  
  1354.  
  1355. ┌───┬─────────────────────────────────────────────────────────────────────
  1356. │ 9 │ List of Spawnable Objects
  1357. └───┘
  1358.  
  1359.     Use these identifiers for the Thing_Spawn() and Thing_SpawnNoFog()
  1360.     specials:
  1361.  
  1362.     T_NONE
  1363.     T_CENTAUR
  1364.     T_CENTAURLEADER
  1365.     T_DEMON
  1366.     T_ETTIN
  1367.     T_FIREGARGOYLE
  1368.     T_WATERLURKER
  1369.     T_WATERLURKERLEADER
  1370.     T_WRAITH
  1371.     T_WRAITHBURIED
  1372.  
  1373.     T_FIREBALL1
  1374.     T_MANA1
  1375.     T_MANA2
  1376.     T_ITEMBOOTS
  1377.     T_ITEMEGG
  1378.     T_ITEMFLIGHT
  1379.     T_ITEMSUMMON
  1380.     T_ITEMTPORTOTHER
  1381.     T_ITEMTELEPORT
  1382.     T_BISHOP
  1383.     T_ICEGOLEM
  1384.     T_BRIDGE
  1385.     T_DRAGONSKINBRACERS
  1386.  
  1387.     T_ITEMHEALTHPOTION
  1388.     T_ITEMHEALTHFLASK
  1389.     T_ITEMHEALTHFULL
  1390.     T_ITEMBOOSTMANA
  1391.     T_FIGHTERAXE
  1392.     T_FIGHTERHAMMER
  1393.     T_FIGHTERSWORD1
  1394.     T_FIGHTERSWORD2
  1395.     T_FIGHTERSWORD3
  1396.     T_CLERICSTAFF
  1397.     T_CLERICHOLY1
  1398.     T_CLERICHOLY2
  1399.     T_CLERICHOLY3
  1400.     T_MAGESHARDS
  1401.     T_MAGESTAFF1
  1402.     T_MAGESTAFF2
  1403.     T_MAGESTAFF3
  1404.     T_MORPHBLAST
  1405.  
  1406.     T_ROCK1
  1407.     T_ROCK2
  1408.     T_ROCK3
  1409.     T_DIRT1
  1410.     T_DIRT2
  1411.     T_DIRT3
  1412.     T_DIRT4
  1413.     T_DIRT5
  1414.     T_DIRT6
  1415.  
  1416.     T_ARROW
  1417.     T_DART
  1418.     T_POISONDART
  1419.     T_RIPPERBALL
  1420.     T_STAINEDGLASS1
  1421.     T_STAINEDGLASS2
  1422.     T_STAINEDGLASS3
  1423.     T_STAINEDGLASS4
  1424.     T_STAINEDGLASS5
  1425.     T_STAINEDGLASS6
  1426.     T_STAINEDGLASS7
  1427.     T_STAINEDGLASS8
  1428.     T_STAINEDGLASS9
  1429.     T_STAINEDGLASS0
  1430.     T_BLADE
  1431.     T_ICESHARD
  1432.     T_FLAME_SMALL
  1433.     T_FLAME_LARGE
  1434.  
  1435.     T_MESHARMOR
  1436.     T_FALCONSHIELD
  1437.     T_PLATINUMHELM
  1438.     T_AMULETOFWARDING
  1439.     T_ITEMFLECHETTE
  1440.     T_ITEMTORCH
  1441.     T_ITEMREPULSION
  1442.     T_MANA3
  1443.     T_PUZZSKULL
  1444.     T_PUZZGEMBIG
  1445.     T_PUZZGEMRED
  1446.     T_PUZZGEMGREEN1
  1447.     T_PUZZGEMGREEN2
  1448.     T_PUZZGEMBLUE1
  1449.     T_PUZZGEMBLUE2
  1450.     T_PUZZBOOK1
  1451.     T_PUZZBOOK2
  1452.  
  1453.     T_METALKEY
  1454.     T_SMALLMETALKEY
  1455.     T_AXEKEY
  1456.     T_FIREKEY
  1457.     T_GREENKEY
  1458.     T_MACEKEY
  1459.     T_SILVERKEY
  1460.     T_RUSTYKEY
  1461.     T_HORNKEY
  1462.     T_SERPENTKEY
  1463.  
  1464.     T_WATERDRIP
  1465.     T_TEMPSMALLFLAME
  1466.     T_PERMSMALLFLAME
  1467.     T_TEMPLARGEFLAME
  1468.     T_PERMLARGEFLAME
  1469.     T_DEMON_MASH
  1470.     T_DEMON2_MASH
  1471.     T_ETTIN_MASH
  1472.     T_CENTAUR_MASH
  1473.     T_THRUSTSPIKEUP
  1474.     T_THRUSTSPIKEDOWN
  1475.     T_FLESH_DRIP1
  1476.     T_FLESH_DRIP2
  1477.     T_SPARK_DRIP
  1478.  
  1479.  
  1480. ┌───┬─────────────────────────────────────────────────────────────────────
  1481. │ 10│ List of Activateable/Deactivateable Objects
  1482. └───┘
  1483.  
  1484.       Activatable:
  1485.  
  1486.     MT_ZTWINEDTORCH             Lights torch
  1487.     MT_ZTWINEDTORCH_UNLIT       Lights torch
  1488.     MT_ZWALLTORCH               Lights torch
  1489.     MT_ZWALLTORCH_UNLIT         Lights torch
  1490.     MT_ZGEMPEDESTAL             Makes gem appear
  1491.     MT_ZWINGEDSTATUENOSKULL     Makes skull appear in hands
  1492.     MT_THRUSTFLOOR_UP           Raises thrust spike (if lowered)
  1493.     MT_THRUSTFLOOR_DOWN         Raises thrust spike
  1494.     MT_ZFIREBULL                Lights flames
  1495.     MT_ZFIREBULL_UNLIT          Lights flames
  1496.     MT_ZBELL                    Rings bell
  1497.     MT_ZCAULDRON                Lights flames
  1498.     MT_ZCAULDRON_UNLIT          Lights flames
  1499.     MT_FLAME_SMALL              Ignites flame
  1500.     MT_FLAME_LARGE              Ignites flame
  1501.     MT_BAT_SPAWNER              Start bat spawning
  1502.  
  1503.     Deactivatable:
  1504.     MT_ZTWINEDTORCH             Extinguish torch
  1505.     MT_ZTWINEDTORCH_UNLIT       Extinguish torch
  1506.     MT_ZWALLTORCH               Extinguish torch
  1507.     MT_ZWALLTORCH_UNLIT         Extinguish torch
  1508.     MT_THRUSTFLOOR_UP           Lower thrust spike
  1509.     MT_THRUSTFLOOR_DOWN         Lower thrust spike
  1510.     MT_ZFIREBULL                Extinguish torch
  1511.     MT_ZFIREBULL_UNLIT          Extinguish torch
  1512.     MT_ZCAULDRON                Extinguish torch
  1513.     MT_ZCAULDRON_UNLIT          Extinguish torch
  1514.     MT_FLAME_SMALL              Extinguish torch
  1515.     MT_FLAME_LARGE              Extinguish torch
  1516.     MT_BAT_SPAWNER              Stop bat spawning
  1517.  
  1518.  
  1519. ┌───┬─────────────────────────────────────────────────────────────────────
  1520. │11 │ List of THINGS that require arguments
  1521. └───┘
  1522.  
  1523.     These THINGS ignore their special types, and use the arg0..arg5 fields
  1524.     for their own purposes:
  1525.  
  1526.         Type: 10225             Bat Spawner
  1527.               arg0:   frequency of spawn (1=fastest, 10=slowest)
  1528.               arg1:   spread angle (0..255)
  1529.               arg2:   unused
  1530.               arg3:   duration of bats (in octics)
  1531.               arg4:   turn amount per move (in degrees [0..255])
  1532.  
  1533.         Type: 10000             Fog Spawner
  1534.               arg0:   movement speed [0..10] (10 == fastest)
  1535.               arg1:   spread angle [0..128] (128 == 180 degrees)
  1536.               arg2:   Frequency of spawn [1..10] (1 == fastest)
  1537.               arg3:   Fog Lifetime [0..255] (5 == 1 second)
  1538.               arg4:   unused
  1539.  
  1540.         Type: 10001             Fog Patch Small
  1541.               arg0:   movement speed [0..10] (10 == fastest)
  1542.               arg1:   unused
  1543.               arg2:   unused
  1544.               arg3:   Fog Lifetime [0..255] (5 == 1 second)
  1545.               arg4:   Boolean: (0 == not moving)
  1546.  
  1547.         Type: 10002             Fog Patch Medium
  1548.               arg0:   movement speed [0..10] (10 == fastest)
  1549.               arg1:   unused
  1550.               arg2:   unused
  1551.               arg3:   Fog Lifetime [0..255] (5 == 1 second)
  1552.               arg4:   Boolean: (0 == not moving)
  1553.  
  1554.         Type: 10003             Fog Patch Large
  1555.               arg0:   movement speed [0..10] (10 == fastest)
  1556.               arg1:   unused
  1557.               arg2:   unused
  1558.               arg3:   Fog Lifetime [0..255] (5 == 1 second)
  1559.               arg4:   Boolean: (0 == not moving)
  1560.  
  1561.         Type: 254               Death Wyvern
  1562.               arg0:   TID of possible destination (required)
  1563.               arg1:   TID of possible destination (optional)
  1564.               arg2:   TID of possible destination (optional)
  1565.               arg3:   TID of possible destination (optional)
  1566.               arg4:   TID of possible destination (optional)
  1567.  
  1568.  
  1569.         The Death Wyvern requires mapspots placed around the map with
  1570.         its args containing TIDs of possible destinations, making up to 5
  1571.         destinations possible from each position.  The choice of next
  1572.         destination is random.  Note that the dragon lich's first
  1573.         destination is the first thing that it can locate that has a TID
  1574.         identical to it's own.
  1575.  
  1576.         Type: 10200   Korax
  1577.           TIDs:
  1578.           245     Korax's mapthing
  1579.           249     Teleport destination (MapSpots)
  1580.         Scripts:
  1581.           249     Run when korax health falls below half
  1582.           250-254 Randomly run by korax as commands
  1583.           255     Run upon death of korax
  1584.  
  1585.  
  1586. ┌───┬─────────────────────────────────────────────────────────────────────
  1587. │12 │ Sector Specials
  1588. └───┘
  1589.  
  1590.     The following numbers are used in the sector.type field [see DOOM
  1591.     specs.]:
  1592.  
  1593.     1   Light_Phased
  1594.     2   LightSequenceStart
  1595.     3   LightSequenceSpecial1
  1596.     4   LightSequenceSpecial2
  1597.  
  1598.     These specials deal with phased lightning ("moving lights").  Two
  1599.     different ways to go about doing phased lighting:  automatic, or
  1600.     by-hand.  
  1601.     
  1602.     The automatic method is (obviously) more convenient, but
  1603.     the by-hand method is more flexible.  Light_Phased is the by-hand
  1604.     special.  Place it on a sector, then set the sector's lightlevel to a
  1605.     phase index (0-63).  As you place the special on nearby sectors,
  1606.     increment the index for each sector.
  1607.  
  1608.     Or, to use the LightSequence specials, just place the LightSequence
  1609.     special on a sector.  Then, for each additional sector, alternate
  1610.     between LightSequenceSpecial1 & LightSequenceSpecial2.
  1611.  
  1612.     For instance, if you wanted phased lightning to flow up a staircase,
  1613.     you could either place Light_Phased on each step, and change the
  1614.     phase index (lightlevel) accordingly.  Or, you could place
  1615.     LightSequenceStart on the bottom step (and set that step's lightlevel
  1616.     to something mid-ranged:  80-128 are pretty nice values), and then
  1617.     let the game calculate the phase indices for each step by placing the
  1618.     LightSequenceSpecial specials on all other steps.  
  1619.     
  1620.     Note that for the LightSequenceSpecial specials to have proper 
  1621.     lighting, set their lightlevels to zero, which causes it to use 
  1622.     the previous sector's lightlevel.  Hence, that "nice value" which 
  1623.     was placed on the first step will iterate through all the other 
  1624.     steps.  If a step's lightlevel is not zero, then that value will 
  1625.     filter down to all other steps after it.
  1626.  
  1627.     26      Stairs_Special1
  1628.     27      Stairs_Special2
  1629.  
  1630.     Used by action specials that build stairs.
  1631.  
  1632.     199     Light_IndoorLightning1
  1633.  
  1634.     Dimmer effect during lightning flash.  Used for indoor areas, which
  1635.     are normally not affected by lightning.
  1636.  
  1637.     198 Light_IndoorLightning2
  1638.  
  1639.         Same as 1, but brighter.
  1640.  
  1641.     200     Sky2
  1642.     Use the alternate sky specified in the mapinfo lump.
  1643.  
  1644.     201     Scroll_North_Slow
  1645.     202     Scroll_North_Medium
  1646.     203     Scroll_North_Fast
  1647.     204     Scroll_East_Slow
  1648.     205     Scroll_East_Medium
  1649.     206     Scroll_East_Fast
  1650.     207     Scroll_South_Slow
  1651.     208     Scroll_South_Medium
  1652.     209     Scroll_South_Fast
  1653.     210     Scroll_West_Slow
  1654.     211     Scroll_West_Medium
  1655.     212     Scroll_West_Fast
  1656.     213     Scroll_NorthWest_Slow
  1657.     214     Scroll_NorthWest_Medium
  1658.     215     Scroll_NorthWest_Fast
  1659.     216     Scroll_NorthEast_Slow
  1660.     217     Scroll_NorthEast_Medium
  1661.     218     Scroll_NorthEast_Fast
  1662.     219     Scroll_SouthEast_Slow
  1663.     220     Scroll_SouthEast_Medium
  1664.     221     Scroll_SouthEast_Fast
  1665.     222     Scroll_SouthWest_Slow
  1666.     223     Scroll_SouthWest_Medium
  1667.     224     Scroll_SouthWest_Fast
  1668.  
  1669.     These all scroll floor flats in their respective directions.  They
  1670.     also move any objects in that direction.
  1671.  
  1672.  
  1673. ┌───┬─────────────────────────────────────────────────────────────────────
  1674. │13 │ Action Specials
  1675. └───┘
  1676.  
  1677.     These are the specials found in the THING.special and LINEDEF.special
  1678.     fields.
  1679.  
  1680.  
  1681.     Floor and Ceiling Specials
  1682.     --------------------------
  1683.  
  1684.     20:Floor_LowerByValue / tag / speed / height / arg4 / arg5
  1685.  
  1686.         tag:            tag of affected sector
  1687.         speed:          speed of move [0..255]
  1688.         height:         relative height of move in pixels
  1689.  
  1690.         Moves the floor of all sectors identified by 'tag'.
  1691.  
  1692.     21:Floor_LowerToLowest / tag / speed / arg3 / arg4 / arg5
  1693.  
  1694.         tag:            tag of affected sector
  1695.         speed:          speed of move [0..255]
  1696.  
  1697.         Lowers floor to lowest adjacent sectors' floor.
  1698.  
  1699.     22:Floor_LowerToNearest / tag / speed / arg3 / arg4 / arg5
  1700.  
  1701.         tag:            tag of affected sector
  1702.         speed:          speed of move [0..255]
  1703.  
  1704.         Lowers floor to next lower adjacent sector's floor.
  1705.  
  1706.     23:Floor_RaiseByValue / tag / speed / height / arg4 / arg5
  1707.  
  1708.         tag:            tag of affected sector
  1709.         speed:          speed of move [0..255]
  1710.         height:         relative height of move in pixels
  1711.  
  1712.         Moves the floor of all sectors identified by 'tag'.
  1713.  
  1714.     24:Floor_RaiseToHighest / tag / speed / arg3 / arg4 / arg5
  1715.  
  1716.         tag:            tag of affected sector
  1717.         speed:          speed of move [0..255]
  1718.  
  1719.         Raises floor to highest adjacent sectors' floor.
  1720.  
  1721.     25:Floor_RaiseToNearest / tag / speed / arg3 / arg4 / arg5
  1722.  
  1723.         tag:            tag of affected sector
  1724.         speed:          speed of move [0..255]
  1725.  
  1726.         Raises floor to next higher adjacent sector's floor.
  1727.  
  1728.     28:Floor_RaiseAndCrush / tag / speed / crush / arg4 / arg5
  1729.  
  1730.         tag:            tag of affected sector
  1731.         speed:          speed of move [0..255]
  1732.         crush:          damage done by crush
  1733.  
  1734.         Raises floor to ceiling and does crushing damage.
  1735.  
  1736.     35:Floor_RaiseByValueTimes8 / tag / speed / height / arg4 / arg5
  1737.  
  1738.         tag:            tag of affected sector
  1739.         speed:          speed of move [0..255]
  1740.         height:         relative height of move in 8 pixel units
  1741.  
  1742.         Raises the floor in increments of 8 units.
  1743.  
  1744.     36:Floor_LowerByValueTimes8 / tag / speed / height / arg4 / arg5
  1745.  
  1746.         tag:            tag of affected sector
  1747.         speed:          speed of move [0..255]
  1748.         height:         relative height of move in 8 pixel units
  1749.  
  1750.         Lowers the floor in increments of 8 units.
  1751.  
  1752.     46:Floor_CrushStop / tag / arg2 / arg3 / arg4 / arg5
  1753.  
  1754.         tag:            tag of affected sector
  1755.  
  1756.         Turns off a crushing floor.
  1757.  
  1758.     66:Floor_LowerInstant / tag / arg2 / height / arg4 / arg5
  1759.  
  1760.         tag:            tag of affected sector
  1761.         height:         relative height in units of 8 pixels
  1762.  
  1763.         Moves the floor down instantly by a specified amount.
  1764.  
  1765.     67:Floor_RaiseInstant / tag / arg2 / height / arg4 / arg5
  1766.  
  1767.         tag:            tag of affected sector
  1768.         height:         relative height in units of 8 pixels
  1769.  
  1770.         Moves the floor up instantly by a specified amount.
  1771.  
  1772.     68:Floor_MoveToValueTimes8 / tag / speed / height / negative / arg5
  1773.  
  1774.         tag:            tag of affected sector
  1775.         speed:          speed of move
  1776.         height:         absolute value in 8 pixel units of destination height
  1777.         negative:       boolean (true if height is negative)
  1778.  
  1779.         Move floor to an absolute height.
  1780.  
  1781.     40:Ceiling_LowerByValue / tag / speed / height / arg4 / arg5
  1782.  
  1783.         tag:            tag of affected sector
  1784.         speed:          speed of move
  1785.         height:         relative height of move in pixels
  1786.  
  1787.         Relative ceiling move.
  1788.  
  1789.     41:Ceiling_RaiseByValue / tag / speed / height / arg4 /arg5
  1790.  
  1791.         tag:            tag of affected sector
  1792.         speed:          speed of move
  1793.         height:         relative height of move in pixels
  1794.  
  1795.         Relative ceiling move.
  1796.  
  1797.     42:Ceiling_CrushAndRaise / tag / speed / crush / arg4 / arg5
  1798.  
  1799.         tag:            tag of affected sector
  1800.         speed:          speed of move
  1801.         crush:          damage of crush
  1802.  
  1803.         Lowers ceiling to crush and raises (continual until stopped)
  1804.  
  1805.     43:Ceiling_LowerAndCrush / tag / speed / crush / arg4 / arg5
  1806.  
  1807.         tag:            tag of affected sector
  1808.         speed:          speed of move
  1809.         crush:          damage of crush
  1810.  
  1811.         Lowers ceiling to floor and stops.
  1812.  
  1813.     44:Ceiling_CrushStop / tag / arg2 / arg3 / arg4 / arg5
  1814.  
  1815.         tag:            tag of affected sector
  1816.  
  1817.         Stop a crushing ceiling.
  1818.  
  1819.     45:Ceiling_CrushRaiseAndStay / tag / speed / crush / arg4 / arg5
  1820.  
  1821.         tag:            tag of affected sector
  1822.         speed:          speed of move
  1823.         crush:          damage of crush
  1824.  
  1825.         Lowers ceiling to crush, raises and stays.
  1826.  
  1827.     69:Ceiling_MoveToValueTimes8 / tag / speed / height / negative / arg5
  1828.  
  1829.         tag:            tag of affected sector
  1830.         speed:          speed of move
  1831.         height:         absolute value in 8 pixel units of destination height
  1832.         negative:       boolean (true if height is negative)
  1833.  
  1834.         Moves ceiling to absolute height.
  1835.  
  1836.     95:FloorAndCeiling_LowerByValue / tag / speed / height / arg4 / arg5
  1837.  
  1838.         tag:            tag of affected sector
  1839.         speed:          speed of move
  1840.         height:         absolute value in 8 pixel units of destination height
  1841.  
  1842.         Relative move of both floor and ceiling.
  1843.  
  1844.     96:FloorAndCeiling_RaiseByValue / tag / speed / height / arg4 / arg5
  1845.  
  1846.         tag:            tag of affected sector
  1847.         speed:          speed of move
  1848.         height:         absolute value in 8 pixel units of destination height
  1849.  
  1850.         Relative move of both floor and ceiling.
  1851.  
  1852.     60:Plat_PerpetualRaise / tag / speed / delay / arg4 / arg5
  1853.  
  1854.         tag:            tag of affected sector
  1855.         speed:          speed of move
  1856.         delay:          delay before reversing direction
  1857.  
  1858.         Continually raises and lowers platform.
  1859.  
  1860.     61:Plat_Stop / tag / arg2 / arg3 / arg4 / arg5
  1861.  
  1862.         tag:            tag of affected sector
  1863.  
  1864.         Stops a PerpectualRaise platform.
  1865.  
  1866.     62:Plat_DownWaitUpStay / tag / speed / delay / arg4 / arg5
  1867.  
  1868.         tag:            tag of affected sector
  1869.         speed:          speed of move
  1870.         delay:          delay before reversing direction
  1871.  
  1872.         One cycle of lowering and raising.
  1873.  
  1874.     63:Plat_DownByValue / tag / speed / delay / height / arg5
  1875.  
  1876.         tag:            tag of affected sector
  1877.         speed:          speed of move
  1878.         delay:          delay before reversing direction
  1879.         height:         relative height in 8 pixel units
  1880.  
  1881.         Relative platform move.
  1882.  
  1883.     64:Plat_UpWaitDownStay / tag / speed / delay / arg4 / arg5
  1884.  
  1885.         tag:            tag of affected sector
  1886.         speed:          speed of move
  1887.         delay:          delay before reversing direction
  1888.  
  1889.         One cycle of raising and lowering.
  1890.  
  1891.     65:Plat_UpByValue / tag / speed / delay / height / arg5
  1892.  
  1893.         tag:            tag of affected sector
  1894.         speed:          speed of move
  1895.         delay:          delay before reversing direction
  1896.         height:         relative height
  1897.  
  1898.         Relative platform move.
  1899.  
  1900.     29:Pillar_Build / tag / speed / height / arg4 / arg5
  1901.  
  1902.         tag:            tag of affected sector
  1903.         speed:          speed of build
  1904.         height:         height (relative to floor) where
  1905.  
  1906.         Makes the floor meet the ceiling.
  1907.  
  1908.     30:Pillar_Open / tag / speed / f_height / c_height / arg5
  1909.  
  1910.         tag:            tag of affected sector
  1911.         speed:          speed of build
  1912.         f_height:       relative height to move floor down
  1913.         c_height:       relative height to move ceiling up
  1914.  
  1915.         Makes the floor and the ceiling meet by moving both.
  1916.  
  1917.     94:Pillar_BuildAndCrush / tag / speed / height / crush / arg5
  1918.  
  1919.         tag:            tag of affected sector
  1920.         speed:          speed of build
  1921.         height:         height (relative to floor) where floor meets ceiling
  1922.         crush:          damage from crushing
  1923.  
  1924.  
  1925.     Stair Specials
  1926.     --------------
  1927.  
  1928.     These stair building specials find the sector with 'tag' and
  1929.     build stairs by traversing adjacent sector marked with the
  1930.     StairSpecial1 and StairSpecial2.  These specials must alternate
  1931.     between the two and must not branch.
  1932.  
  1933.     26:Stairs_BuildDown / tag / speed / height / delay / reset
  1934.  
  1935.         tag:            tag of sector to start in
  1936.         speed:          speed of build [0.255]
  1937.         height:         height of step in pixels
  1938.         delay:          delay between steps in tics
  1939.         reset:          delay before stairs to reset (0==no reset)
  1940.  
  1941.     27:Stairs_BuildUp / tag / speed / height / delay / reset
  1942.  
  1943.         tag:            tag of sector to start in
  1944.         speed:          speed of build [0.255]
  1945.         height:         height of step in pixels
  1946.         delay:          delay between steps in tics
  1947.         reset:          delay before stairs to reset (0==no reset)
  1948.  
  1949.     31:Stairs_BuildDownSync / tag / speed / height / reset / arg5
  1950.  
  1951.         tag:            tag of sector to start in
  1952.         speed:          speed of build [0.255]
  1953.         height:         height of step in pixels
  1954.         reset:          delay before stairs to reset (0==no reset)
  1955.  
  1956.     32:Stairs_BuildUpSync / tag / speed / height / reset / arg5
  1957.  
  1958.         tag:            tag of sector to start in
  1959.         speed:          speed of build [0.255]
  1960.         height:         height of step in pixels
  1961.         reset:      delay before stairs to reset (0==no reset)
  1962.  
  1963.  
  1964.     Door Specials
  1965.     -------------
  1966.  
  1967.     10:Door_Close / tag / speed / arg3 / arg4 / arg5
  1968.  
  1969.         tag:            tag of affected sector or zero if line is part of door
  1970.         speed:          speed of move
  1971.  
  1972.         Closes a door sector.
  1973.  
  1974.     11:Door_Open / tag / speed / arg3 / arg4 / arg5
  1975.  
  1976.         tag:            tag of affected sector or zero if line is part of door
  1977.         speed:          speed of move
  1978.  
  1979.         Opens a door sector.
  1980.  
  1981.     12:Door_Raise / tag / speed / delay / arg4 / arg5
  1982.  
  1983.         tag:            tag of affected sector or zero if line is part of door
  1984.         speed:          speed of move
  1985.         delay:          delay before door lowers
  1986.  
  1987.     13:Door_LockedRaise / tag / speed / delay / lock / arg5
  1988.  
  1989.         tag:            tag of affected sector or zero if line is part of door
  1990.         speed:          speed of move
  1991.         delay:          delay before door lowers
  1992.         lock:           key number that will unlock door (see key numbers)
  1993.  
  1994.         Raises a door if correct key is in inventory of triggering player.
  1995.  
  1996.  
  1997.     Script Specials
  1998.     ---------------
  1999.  
  2000.     80:ACS_Execute / script / map / s_arg1 / s_arg2 / s_arg3
  2001.  
  2002.         script:         script number to execute
  2003.         map:            map which contains the script
  2004.  
  2005.     81:ACS_Suspend / script / map / arg3 / arg4 / arg5
  2006.  
  2007.         script:         script number to suspend
  2008.         map:            map which contains the script
  2009.  
  2010.     82:ACS_Terminate / script / map / arg3 / arg4 / arg5
  2011.  
  2012.         script:         script number to suspend
  2013.         map:            map which contains the script
  2014.  
  2015.     83:ACS_LockedExecute / script / map / s_arg1 / s_arg2 / lock
  2016.  
  2017.         script:         script number to suspend
  2018.         map:            map which contains the script
  2019.         lock:           key number needed to run script (see key numbers)
  2020.  
  2021.  
  2022.     Light Specials
  2023.     --------------
  2024.  
  2025.     110:Light_RaiseByValue / tag / value / arg3 / arg4 / arg5
  2026.  
  2027.         tag:            tag of affected sector
  2028.         value:          relative value of light level change
  2029.  
  2030.     111:Light_LowerByValue / tag / value / arg3 / arg4 / arg5
  2031.  
  2032.         tag:            tag of affected sector
  2033.         value:          relative value of light level change
  2034.  
  2035.     112:Light_ChangeToValue / tag / value / arg3 / arg4 / arg5
  2036.  
  2037.         tag:            tag of affected sector
  2038.         value:          absolute value of light level change
  2039.  
  2040.     113:Light_Fade / tag / value / tics / arg4 / arg5
  2041.  
  2042.         tag:            tag of affected sector
  2043.         value:          absolute value of light level change
  2044.         tics:           number of tics to fade to light level
  2045.  
  2046.     114:Light_Glow / tag / upper / lower / tics / arg5
  2047.  
  2048.         tag:            tag of affected sector
  2049.         upper:          brightest light level
  2050.         lower:          lowest light level
  2051.         tics:           number of tics between light changes
  2052.  
  2053.     115:Light_Flicker / tag / upper / lower / arg4 / arg5
  2054.  
  2055.         tag:            tag of affected sector
  2056.         upper:          brightest light level
  2057.         lower:          lowest light level
  2058.  
  2059.     116:Light_Strobe / tag / upper / lower / u-tics / l-tics
  2060.  
  2061.         tag:            tag of affected sector
  2062.         upper:          brightest light level
  2063.         lower:          lowest light level
  2064.         u-tics:         tics to stay at upper light level
  2065.         l-tics:         tics to stay at lower light level
  2066.  
  2067.  
  2068.     Miscellaneous Specials
  2069.     ----------------------
  2070.  
  2071.     121:Line_SetIdentification / line / arg2 / arg3 / arg4 / arg5
  2072.  
  2073.         line:           unique id of this line
  2074.  
  2075.         The script functions setlineblocking, setlinespecial, and
  2076.         setlinetexture use the ID specified here to identify lines.
  2077.  
  2078.     100:Scroll_Texture_Left  / speed / arg2 / arg3 / arg4 / arg5
  2079.  
  2080.     101:Scroll_Texture_Right / speed / arg2 / arg3 / arg4 / arg5
  2081.  
  2082.     102:Scroll_Texture_Up    / speed / arg2 / arg3 / arg4 / arg5
  2083.  
  2084.     103:Scroll_Texture_Down  / speed / arg2 / arg3 / arg4 / arg5
  2085.  
  2086.         speed:      speed of scroll in pixels
  2087.  
  2088.     129:UsePuzzleItem / item / script / s_arg1 / s_arg2 / s_arg3
  2089.  
  2090.         item:           item number needed to activate
  2091.         script:         script to run upon activation
  2092.  
  2093.         Runs a script upon use of appropriate puzzle item:
  2094.  
  2095.         0   ZZ_Skull
  2096.         1   ZZ_BigGem
  2097.         2   ZZ_GemRed
  2098.         3   ZZ_GemGreen1
  2099.         4   ZZ_GemGreen2
  2100.         5   ZZ_GemBlue1
  2101.         6   ZZ_GemBlue2
  2102.         7   ZZ_Book1
  2103.         8   ZZ_Book2
  2104.         9   ZZ_Skull2
  2105.         10  ZZ_FWeapon
  2106.         11  ZZ_CWeapon
  2107.         12  ZZ_MWeapon
  2108.         13  ZZ_Gear
  2109.         14  ZZ_Gear2
  2110.         15  ZZ_Gear3
  2111.         16  ZZ_Gear4
  2112.  
  2113.     140:Sector_ChangeSound / tag / sound / arg3 / arg4 /  arg5
  2114.  
  2115.         tag:            tag of sector to contain sound
  2116.         sound:          sound to be played - see sector sounds
  2117.  
  2118.     120:Earthquake / intensity / duration / damrad / tremrad / tid
  2119.  
  2120.         intensity:      strength of earthquake in richters [1..9]
  2121.         duration:       duration in tics [1..255]
  2122.         damrad:         radius of damage in 64x64 cells [0..255]
  2123.         tremrad:        radius of tremor in 64x64 cells [0..255]
  2124.         tid:            TID of map thing(s) for quake foci
  2125.  
  2126.         Creates an earthquake at all matching foci.
  2127.  
  2128.     74:Teleport_NewMap / map / position / arg3 / arg4 / arg5
  2129.  
  2130.         map:            map to teleport to
  2131.         position:       corresponds to destination player start spot arg0.
  2132.  
  2133.         Teleports the player to a new map and to the player start spot
  2134.         whose arg0 member matches 'position.'
  2135.  
  2136.     75:Teleport_EndGame / arg1 / arg2 / arg3 / arg4 / arg5
  2137.  
  2138.          Ends game and runs finale script.
  2139.          In deathmatch, teleports to level 1.
  2140.  
  2141.     70:Teleport / tid / arg2 / arg3 / arg4 / arg5
  2142.  
  2143.         tid:            TID of destination
  2144.  
  2145.         Teleports triggering object to MapSpot with tid.
  2146.  
  2147.     71:Teleport_NoFog / tid / arg2 / arg3 / arg4 / arg5
  2148.  
  2149.        Same as teleport, but silent with no fog sprite.
  2150.  
  2151.  
  2152.     Thing Specials
  2153.     --------------
  2154.  
  2155.     72:ThrustThing / angle / distance / arg3 / arg4 / arg5
  2156.  
  2157.         angle:          byte angle to thrust [0..255]
  2158.         distance:       distance to thrust
  2159.  
  2160.     73:DamageThing / damage / arg2 / arg3 / arg4 / arg5
  2161.  
  2162.         damage:         amount of damage
  2163.  
  2164.     130:Thing_Activate / tid / arg2 / arg3 / arg4 / arg5
  2165.  
  2166.         tid:            TID of thing to activate (see activatable things)
  2167.  
  2168.     131:Thing_Deactivate / tid / arg2 / arg3 / arg4 / arg5
  2169.  
  2170.         tid:            TID of thing to deactivate (see deactivatable things)
  2171.  
  2172.     132:Thing_Remove / tid / arg2 / arg3 / arg4 / arg5
  2173.  
  2174.         tid:            TID of thing to remove
  2175.  
  2176.     133:Thing_Destroy / tid / arg2 / arg3 / arg4 / arg5
  2177.  
  2178.         tid:            TID of affected thing
  2179.  
  2180.         Puts thing into its death state.
  2181.  
  2182.     134:Thing_Projectile / tid / type / angle / speed / vspeed
  2183.  
  2184.         tid:            TID of spawn location
  2185.         type:           Type of thing to spawn (see spawnable things)
  2186.         angle:          byte angle of projectile
  2187.         speed:          speed of projectile
  2188.         vspeed:         vertical speed
  2189.  
  2190.         Spawns a projectile.
  2191.  
  2192.     136:Thing_ProjectileGravity / tid / type / angle / speed / vspeed
  2193.  
  2194.         tid:            TID of spawn location
  2195.         type:           Type of thing to spawn (see spawnable things)
  2196.         angle:          byte angle of projectile
  2197.         speed:          speed of projectile
  2198.         vspeed:         vertical speed
  2199.  
  2200.         Spawns a projectile with gravity.
  2201.  
  2202.     135:Thing_Spawn / tid / type / angle / arg4 / arg5
  2203.  
  2204.         tid:            TID of spawn location
  2205.         type:           Type of thing to spawn (see spawnable things)
  2206.         angle:          byte angle of thing to face
  2207.  
  2208.         Spawns a thing.
  2209.  
  2210.     137:Thing_SpawnNoFog / tid / type / angle / arg4 / arg5
  2211.  
  2212.         tid:            TID of spawn location
  2213.         type:           Type of thing to spawn (see spawnable things)
  2214.         angle:          byte angle of projectile
  2215.  
  2216.         Spawns a thing silently.
  2217.  
  2218.  
  2219.     PolyObject Specials
  2220.     --------------------
  2221.  
  2222.     1:Polyobj_StartLine / po / mirror / sound / arg4 / arg5
  2223.  
  2224.         po:             refer to a particular polyobj
  2225.         mirror:         poly that will mirror the moves of this poly
  2226.         sound:          See Section 5:  Sector Sound
  2227.  
  2228.     2:Polyobj_RotateLeft / po / speed / angle / arg4 / arg5
  2229.  
  2230.         po:             polyobj
  2231.         speed:          speed
  2232.         angle:          byte angle to rotate
  2233.  
  2234.     3:Polyobj_RotateRight / po / speed / angle / arg4 / arg5
  2235.  
  2236.         po:             polyobj
  2237.         speed:          speed
  2238.         angle:          byte angle to rotate
  2239.  
  2240.     4:Polyobj_Move / po / speed / angle / distance / arg5
  2241.  
  2242.         po:             polyobj
  2243.         speed:          speed
  2244.         angle:          byte angle to move along
  2245.         distance:       byte distance to move
  2246.  
  2247.     5:Polyobj_ExplicitLine / po / order / mirror / sound / arg5
  2248.  
  2249.         po:             polyobj
  2250.         order:          rendering order of this line
  2251.         mirror:         poly that will mirror the moves of this poly
  2252.         sound:          See Section 5:  Sector Sound
  2253.  
  2254.     6:Polyobj_MoveTimes8 / po / speed / angle / distance / arg5
  2255.  
  2256.         po:             polyobj
  2257.         speed:          speed
  2258.         angle:          byte angle
  2259.         distance:       byte distance to move in units of 8
  2260.  
  2261.     7:Polyobj_DoorSwing / po / speed / angle / delay / arg5
  2262.  
  2263.         po:             polyobj
  2264.         speed:          speed
  2265.         angle:          byte angle
  2266.         delay:          delay in tics
  2267.  
  2268.     8:Polyobj_DoorSlide / po / speed / angle / distance / delay
  2269.  
  2270.         po:             polyobj
  2271.         speed:          speed
  2272.         angle:          byte angle
  2273.         distance:       byte distance
  2274.         delay:          delay in tics
  2275.  
  2276.     90:Polyobj_OR_RotateLeft  / po / speed / angle / arg4 / arg5
  2277.     91:Polyobj_OR_RotateRight / po / speed / angle / arg4 / arg5
  2278.     92:Polyobj_OR_Move        / po / speed / angle / distance / arg5
  2279.     93:Polyobj_OR_MoveTimes8  / po / speed / angle / distance / arg5
  2280.  
  2281.   The OR stands for OverRide.  As stated before, each poly can only be doing 
  2282.   a single action at a time.  This poses a problem with perpetual polyobjs, 
  2283.   since they are already moving, the designer cannot do anything else with 
  2284.   them.
  2285.  
  2286.   However, using these functions the designer can override the code to not
  2287.   allow a poly to concurrently execute more than one action, and force a poly
  2288.   to do the other action as well.
  2289.  
  2290.  
  2291. ┌───┬─────────────────────────────────────────────────────────────────────
  2292. │14 │ Sector Sounds for ChangeSectorSound() special:
  2293. └───┘
  2294.  
  2295.     1       heavy
  2296.     2       metal
  2297.     3       creak
  2298.     4       silence
  2299.     5       lava
  2300.     6       water
  2301.     7       ice
  2302.     8       earth
  2303.     9       metal2
  2304.  
  2305.  
  2306. ┌───┬─────────────────────────────────────────────────────────────────────
  2307. │15 │ Sounds for ThingSound()       (Added by SBS)
  2308. └───┘
  2309.  
  2310.    void thingsound(int tid, str name, int volume);
  2311.    -----------------------------------------------
  2312.  
  2313.    str name <--- possible values (we didn't check these out 100%)
  2314.  
  2315.    PlayerFighterNormalDeath
  2316.    PlayerFighterCrazyDeath
  2317.    PlayerFighterExtremeDeath
  2318.    PlayerFighterExtreme2Death
  2319.    PlayerFighterExtreme3Death
  2320.    PlayerFighterBurnDeath
  2321.    PlayerFighterPain
  2322.    PlayerFighterGrunt
  2323.    PlayerFighterFallingScreen
  2324.    PlayerFighterFailed
  2325.  
  2326.    PlayerClericNormalDeath
  2327.    + .. same as fighter ..+
  2328.  
  2329.    PlayerMageNormalDeath
  2330.    + .. same as fighter ..+
  2331.  
  2332.    PlayerLand
  2333.    PlayerPoisonCough
  2334.    PlayerFallingSplat
  2335.  
  2336.    PlatformStart
  2337.    PlatformStartMetal
  2338.    PlatformStop
  2339.  
  2340.    StoneMove
  2341.    MetalMove
  2342.  
  2343.    DoorOpen
  2344.    DoorLocked
  2345.  
  2346.    DoorOpenMetal
  2347.    DoorCloseMetal
  2348.    DoorCloseLight
  2349.    DoorCloseHeavy
  2350.    DoorCreak
  2351.  
  2352.    PickupWeapon
  2353.    PickupArtifact
  2354.    PickupKey
  2355.    PickupItem
  2356.    PickupPiece
  2357.  
  2358.    FighterPunchMiss
  2359.    FighterPunchHitThing
  2360.    FighterPunchHitWall
  2361.    FighterGrunt
  2362.    FighterAxeHitThing
  2363.    FighterHammerMiss
  2364.    FighterHammerHitThing
  2365.    FighterHammerHitWall
  2366.    FighterHammerContinuous
  2367.    FighterHammerExplode
  2368.    FighterSwordFire
  2369.    FighterSwordExplode
  2370.  
  2371.    ClericCstaffFire
  2372.    ClericCstaffExplode
  2373.    ClericCstaffHitThing
  2374.    ClericFlameFire
  2375.    ClericFlameExplode
  2376.    ClericFlameCircle
  2377.  
  2378.    MageWandFire
  2379.    MageLightningFire
  2380.    MageLightningZap
  2381.    MageLightningContinuous
  2382.    MageLightningReady
  2383.  
  2384.    MageShardsFire
  2385.    MageShardsExplode
  2386.  
  2387.    MageStaffFire
  2388.    MageStaffExplode
  2389.  
  2390.    Switch1
  2391.    Switch2
  2392.  
  2393.    SerpentSight
  2394.    SerpentActive
  2395.    SerpentPain
  2396.    SerpentAttack
  2397.    SerpentMeleeHit
  2398.    SerpentDeath
  2399.    SerpentBirth
  2400.    SerpentFXContinous
  2401.    SerpentFxHit
  2402.  
  2403.    CentaurSight
  2404.    CentaurActive
  2405.    CentaurPain
  2406.    CentaurAttack
  2407.    CentaurDeath
  2408.    CentaurLeaderAttack
  2409.    CentaurMissileExplode
  2410.  
  2411.    BishopSight
  2412.    BishopActive
  2413.    BishopPain
  2414.    BishopAttack
  2415.    BishopDeath
  2416.    
  2417.    BishopMissileExplode
  2418.    BishopBlur
  2419.  
  2420.    DemonSight
  2421.    DemonActive
  2422.    DemonPain
  2423.    DemonAttack
  2424.    DemonMissileFire
  2425.    DemonMissileExplode
  2426.    DemonDeath
  2427.  
  2428.    WraithSight
  2429.    WraithActive
  2430.    WraithPain
  2431.    WraithAttack
  2432.    WraithMissileFire
  2433.    WraithMissileExplode
  2434.    WraithDeath
  2435.  
  2436.    PigActive1
  2437.    PigActive2
  2438.    PigPain
  2439.    PigAttack
  2440.    PigDeath
  2441.  
  2442.    MaulatorSight
  2443.    MaulatorActive
  2444.    MaulatorPain
  2445.    MaulatorHammerSwing
  2446.    MaulatorHamHit
  2447.    MaulatorMissileHit
  2448.    MaulatorDeath
  2449.  
  2450.    FreezeDeath
  2451.    FreezeShatter
  2452.    
  2453.    EttinSight
  2454.    EttinActive
  2455.    EttinPain
  2456.    EttinAttack
  2457.    EttinDeath
  2458.  
  2459.    FireDemonSpawn
  2460.    FireDemonActive
  2461.    FireDemonPain
  2462.    FireDemonAttack
  2463.    FireDemonMissileHit
  2464.    FireDemonDeath
  2465.  
  2466.    IceGuySight
  2467.    IceGuyActive
  2468.    IceGuyAttack
  2469.    IceGuyMissileExplode
  2470.  
  2471.    SorcererSight
  2472.    SorcererActive
  2473.    SorcererPain
  2474.    SorcererSpecialCast
  2475.    SorcererBallWoosh
  2476.    SorcererDeathScream
  2477.    SorcererBishopSpawn
  2478.    SorcererBallPop
  2479.    SorcererBallBounce
  2480.    SorcererBallExplode
  2481.    SorcererBigBallExplode
  2482.    SorcererHeadScream
  2483.    
  2484.    DragonSight
  2485.    DragonActive
  2486.    DragonWingFlap
  2487.    DragonAttack
  2488.    DragonPain
  2489.    DragonDeath
  2490.    DragonFireBallExplode
  2491.  
  2492.    KoraxSight
  2493.    KoraxActive
  2494.    KoraxPain
  2495.    KoraxAttack
  2496.    KoraxCommand
  2497.    KoraxDeath
  2498.    KoraxStep
  2499.  
  2500.    ThrustSpikeRaise
  2501.    ThrustSpikeLower
  2502.  
  2503.    BlastRadius
  2504.    EarthStartMove
  2505.    FlechetteBounce
  2506.    FlechetteExplode
  2507.    GlassShatter
  2508.    HolySymbolFire
  2509.    Teleport
  2510.    ThunderCrash
  2511.    UseArtifact
  2512.    WeaponBuild
  2513.  
  2514.    IceStartMove
  2515.    LavaMove
  2516.    LavaSizzle
  2517.    SludgeGloop
  2518.    WaterMove
  2519.    WaterSplash
  2520.    
  2521.    SpiritActive
  2522.    SpiritAttack
  2523.    SpiritDie
  2524.  
  2525.    PuzzleSuccess
  2526.    PuzzleFailFighter
  2527.    PuzzleFailCleric
  2528.    PuzzleFailMage
  2529.  
  2530.    Ambient1
  2531.    Ambient2
  2532.    Ambient3
  2533.    Ambient4
  2534.    Ambient5
  2535.    Ambient6
  2536.    Ambient7
  2537.    Ambient8
  2538.    Ambient9
  2539.    Ambient10
  2540.    Ambient11
  2541.    Ambient12
  2542.    Ambient13
  2543.    Ambient14
  2544.    Ambient15
  2545.  
  2546.    KoraxVoiceGreetings
  2547.    KoraxVoiceReady
  2548.    KoraxVoiceBlood
  2549.    KoraxVoiceGame
  2550.    KoraxVoiceBoard
  2551.    KoraxVoiceWorship
  2552.    KoraxVoiceMaybe
  2553.    KoraxVoiceStrong
  2554.    KoraxVoiceFace
  2555.  
  2556.    BatScream
  2557.    BellRing
  2558.    Chat
  2559.    ClockTick
  2560.    Drip
  2561.  
  2562.    EarthQuake
  2563.    FireBall
  2564.    FlyBuzz
  2565.    Ignite
  2566.    MenuMove
  2567.    MysticIncant
  2568.  
  2569.    PoisonShroomPain
  2570.    PoisonShroomDeath
  2571.    PotteryExpode
  2572.    PuppyBeat
  2573.    Respawn
  2574.    RopePull
  2575.  
  2576.    StartupTick
  2577.    SuitofArmorBreak
  2578.    SwitchOtherLevel
  2579.    TreeBreak
  2580.    TreeExplode
  2581.    ValveTurn
  2582.    Wind
  2583.  
  2584.  
  2585. ┌───┬─────────────────────────────────────────────────────────────────────
  2586. │16 │ Key Numbers
  2587. └───┘
  2588.  
  2589.     These are referenced by the DoorRaiseLocked() and ACS_ExecuteLocked()
  2590.     specials.
  2591.  
  2592.     1   steel key
  2593.     2   cave key
  2594.     3   axe key
  2595.     4   fire key
  2596.     5   emerald key
  2597.     6   dungeon key
  2598.     7   silver key
  2599.     8   rusted key
  2600.     9   horn key
  2601.     10  swamp key
  2602.     11  castle key
  2603.  
  2604.   ───────────────────── End of Specs ────────────────────────────────────
  2605.